package study.HL7.lis_hl7;

import ca.uhn.hl7v2.parser.Parser;
import ca.uhn.hl7v2.parser.PipeParser;

/**
 * @Author 刘伟涛
 * @Date 2024/8/6 15:01
 **/
public class TestParse {
    public static void main(String[] args) throws Exception {
        String message = "MSH|^~\\&|LIS|Hospital|EHR|20240805||ORU^R01|123456|P|2.3\r"
                + "PID|||123456^^^Hospital^MR||Doe^John||19800101|M\r"
                + "OBR|1|12345678|987654|CBC^Complete Blood Count\r"
                + "OBX|1|NM|WBC^White Blood Cell Count||5.4|10^9/L|4.0-11.0|N|||F";

        Parser parser = new PipeParser();
/*        ORU_R01 oruMessage = (ORU_R01) parser.parse(message);

        // 解析消息内容
        String patientName = oruMessage.getRESPONSE().getPATIENT().getPID().getPatientName(0).getFamilyName().getValue();
        System.out.println("Patient Name: " + patientName);*/
    }
}
